Information on the PRINTOUT module
==================================

This is the printout extension module for Account.

For installation instructions, please refer to "Install.txt".


Printout?
---------

At some time or other, you are bound to want to print your
account data. Certainly, comparing a printout with your statement
can be easier than reading off the screen - especially if you are
sitting in bed with a cup of tea and the post, under a tungsten
bulb, trying to wake up...
These are not ideal conditions for handling anything mathematical,
but you'd be surprised how many people do it!

At this time the printout extension prints out everything in the
account; a future version will allow you to print out everything,
or just a specified month.



Creating a printout
-------------------

a. Press Acorn-E (or Psion-E) to open the "Extensions" dialogue.

b. Select the "Print out your account entries" option.

c. A new dialogue will appear.

   Choose if you wish to output to:
     File     - A file on a local SSD or the internal device, or
                on a remote machine via PsiWin.
     Serial   - A printer connected via the serial port.
     Parallel - A printer connected via the parallel port.

   Now choose the output format:
     Plain text (no formatting)
     HTML (basic 3.2)
     Canon Generic BubbleJet
     Epson FX-80 (or compatible)
     HP DeskJet/LaserJet (basic PCL driver)
   More details on these below.

d. If you are printing to a file, then you will now be asked to
   specify the file. You will also be asked to confirm if you
   will be overwriting an existing file.

e. A message will blink at the bottom-left of the screen during
   the printing process.
   [I will implement a slidey-bar in a later version]

f. Once complete, you will be returned to Account.



Printer formats
---------------

The very first thing to be aware of is that the character set of
the output is that of the organiser - which on a Windows machine
is referred to as OEM or DOS.
You may need to instruct your printer to use the DOS or IBM
character set. Of course, this is only going to be an issue to
you if you use accented characters.

  Plain text (no formatting)
    Essentially all of the outputs are based upon this. The main
    difference is that the other outputs have 'styles' (bold,
    underlined, etc).
    This is demonstrated in the file "printout example.txt".

  HTML (basic 3.2)
    This outputs your printout in an HTML form. Be aware that it
    uses a meta-tag to specify the character set as being DOS and
    not Windows or ISO Latin. It will look correct in MSIE,
    though not necessarily in browsers that have less complete
    character set handling, or less complete/insufficient meta
    tag parsing.
    This is demonstrated in the file "printout example.html".

  Canon Generic BubbleJet
    It appears (from examination of the RISC OS printer drivers)
    that all of the BJC range of printers (like the BJC-4000) all
    use the same codes. Of course, their physical capabilities
    (and ways to access special features) will differ greatly,
    but for things like "italic text" and "bold text", the codes
    are the same.
    [BubbleJet support has NOT been tested - I don't have a Canon]

  Epson FX-80 (or compatible)
    When all else fails, try this. Like most modems understand the
    "Hayes" command set (the "AT" sequences) simply because Hayes
    did it first, and best... Most printers understand (or can be
    configured to understand) the Epson codes.
    While it says "FX-80", the codes used are the same for a wide
    variety of printers - the LQ range (or anything that can
    pretend to be an LQ), the IBM graphics printer, Panasonic's
    KX-P1180. If your printer is NOT a Windows printer (i.e. not
    one that has a USB interface and complex Windows driver), why
    not try this if all else fails?
    [Epson support has NOT been tested yet]

  HP DeskJet/LaserJet (basic PCL driver)
    By using Hewlett Packard's PCL codes, this output will work
    with the majority of DeskJet and LaserJet models, and those
    printers that claim to be LaserJet or DeskJet compatible.
    This is demonstrated in the file "printout example.pdf" which
    was created using a PCL to PDF translator.



Adding your own printers/modifying existing settings
----------------------------------------------------

Load the file "\APP\ACCOUNT\Prntaext.dbf" into Cards (the Psion
Database application).

There are 11 fields:
          Name  The name of the output format.
    Initialise  What to output before the printout begins.
      Finalise  What to output once the printout is done.
       Bold on  Code to turn 'bold' text style on.
      Bold off  Code to turn 'bold' text style off.
    Italics on  Code to turn 'italicised' text style on.
   Italics off  Code to turn 'italicised' text style off.
 Underlined on  Code to turn 'underlined' text style on.
Underlined off  Code to turn 'underlined' text style off.
 Emphasised on  Code to turn 'emphasised' text style on.
Emphasised off  Code to turn 'emphasised' text style off.


With the title banner, two assumptions are made:
  1. If the style is plain text (there is NO 'bold on' code), then
     the title is centred according to 80 column width; otherwise
     it is aligned according to 40 column width. Emphasised
     printing is expected to be double-width.

  2. If the style is HTML (the second character of the 'bold on'
     code is "<"), the title has no space padding, the alignment
     should be performed using HTML tags.
These assumptions should be kept in mind while adding/editing the
style data.


Each database entry (except the Name) should follow a special coded
sequence.
Here is an example of the HP PCL initialisation:
  27,"E",27,"(12U",27,"(s12H"
This breaks down to be an escape code (ASCII 27), followed by the
character "E", another escape, the string "(12U", another escape,
and finally the string "(s12H".

The example, essentially, explains everything you need to know.
All of the control characters are given as numbers (in base 10, not
hex), while all of the printable characters are enclosed in quotes,
everything being separated by commas.
The following will all produce identical output:
  "hello"
  104,101,108,108,111
  104,"e",108,"l",111

The output of incorrect input (i.e. '27,"missing end quote,0'), is
undefined. Most likely incorrect information will be output to the
printer (or file), but the module may terminate with an error, so
be sure to double-check your definitions.


The maximum length of each command sequence is 250 characters. In
addition, the maximum length of the list of names is also 250
characters (so don't add too many new definitions without getting
rid of the ones you don't need).



Rick, 2006/10/31
